﻿Imports XpsIndexer


Public Class FrmMain

    Private _Openwidth As Integer
    Private _Closewidth As Integer

    Private Sub FrmMain_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        _Openwidth = Me.Width

        _Closewidth = Me.scMain.Panel1.Width + Me.ToolStripContainer.RightToolStripPanel.Width + 6

        tsbXPSReader_Click(sender, e)


    End Sub


    Private Sub btnSendEvent_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSendEvent.Click

        If ofd.ShowDialog = Windows.Forms.DialogResult.OK Then

            Dim indexer As New Indexer
            indexer.SendEvent(ofd.FileName)  ', "", "Hellow word!")

        End If
    End Sub
    Private Sub btnUnregister_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnUnregister.Click
        Dim indexer As New Indexer
        indexer.UnregisterIndexer()
    End Sub
    Private Sub btnRegister_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnRegister.Click
        Dim indexer As New Indexer
        indexer.RegisterIndexer()
    End Sub

    Private Sub tsbXPSReader_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tsbXPSReader.Click

        If Me.scMain.Panel2Collapsed Then
            Me.tsbXPSReader.Text = "<"
            Me.Width = _Openwidth
            Me.scMain.Panel2Collapsed = False
        Else
            Me.tsbXPSReader.Text = ">"
            Me.Width = _Closewidth
            Me.scMain.Panel2Collapsed = True

        End If

    End Sub

    Private Sub btnReadXPS_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnReadXPS.Click
        If Me.ofd.ShowDialog = Windows.Forms.DialogResult.OK Then

            Dim indexer As New Indexer

            Me.txt.Text = indexer.ReadXps(Me.ofd.FileName)


        End If

    End Sub


End Class
